﻿using Ping9719.WpfEx.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace AutoFlatnessTest.ViewModel
{
    public class UcProjectVModel : BindableBase
    {

        #region 页面逻辑
        private bool selectNoNull = false;

        public bool SelectNoNull
        {
            get { return selectNoNull; }
            set { selectNoNull = value; RaisePropertyChanged(nameof(SelectNoNull)); }
        }

        private Visibility vis = Visibility.Collapsed;
        /// <summary>
        /// 显示无法连接
        /// </summary>
        public Visibility Vis
        {
            get { return vis; }
            set { vis = value; RaisePropertyChanged(nameof(Vis)); }
        }

        private Visibility visLjck = Visibility.Collapsed;
        /// <summary>
        /// 显示无法连接
        /// </summary>
        public Visibility VisLjck
        {
            get { return visLjck; }
            set { visLjck = value; RaisePropertyChanged(nameof(VisLjck)); }
        }

        #endregion



        #region 项目
        /// <summary>
        /// 项目
        /// </summary>
        private Dictionary<string, string> Proj_ = new Dictionary<string, string>();
        /// <summary>
        /// 行数
        /// </summary>
        private int? RowNum_;
        /// <summary>
        /// 列数
        /// </summary>
        private int? ColumnNum_;
        /// <summary>
        /// 主页显示
        /// </summary>
        private bool homevis { get; set; }
        /// <summary>
        /// 是否扫码（1是）
        /// </summary>
        private bool IsSma_ { get; set; }
        /// <summary>
        /// 是否Check过站管控
        /// </summary>
        private bool IsCheck_;
        /// <summary>
        /// 通过值（芯片）。原意义：通过警告值
        /// </summary>
        private decimal? OkValWarn_;
        /// <summary>
        /// 通过值
        /// </summary>
        private decimal? OkVal_;
        /// <summary>
        /// 单次宽度
        /// </summary>
        private int? OneWidth_;
        /// <summary>
        /// 单次运载起点
        /// </summary>
        private int? OneYz1_;
        /// <summary>
        /// 单次运载终点
        /// </summary>
        private int? OneYz2_;
        /// <summary>
        /// 单次扫描起点
        /// </summary>
        private int? OneSmi1_;
        /// <summary>
        /// 单次扫描终点
        /// </summary>
        private int? OneSmi2_;
        /// <summary>
        /// 单次扫码起点
        /// </summary>
        private int? OneSma1_;
        /// <summary>
        /// 单次扫码终点
        /// </summary>
        private int? OneSma2_;
        /// <summary>
        /// 连续运载起点
        /// </summary>
        private int? TwoYz1_;
        /// <summary>
        /// 连续运载终点
        /// </summary>
        private int? TwoYz2_;
        /// <summary>
        /// 连续扫描起点
        /// </summary>
        private int? TwoSmi1_;
        /// <summary>
        /// 连续扫描终点
        /// </summary>
        private int? TwoSmi2_;
        /// <summary>
        /// 连续扫码起点
        /// </summary>
        private int? TwoSma1_;
        /// <summary>
        /// 连续扫码终点
        /// </summary>
        private int? TwoSma2_;
        /// <summary>
        /// 排序码
        /// </summary>
        private int? Sort_;



        /// <summary>
        /// 项目
        /// </summary>
        public Dictionary<string, string> Proj { get => Proj_; set { Proj_ = value; RaisePropertyChanged(nameof(Proj)); } }
        /// <summary>
        /// 行数
        /// </summary>
        public int? RowNum { get => RowNum_; set { RowNum_ = value; RaisePropertyChanged(nameof(RowNum)); } }
        /// <summary>
        /// 列数
        /// </summary>
        public int? ColumnNum { get => ColumnNum_; set { ColumnNum_ = value; RaisePropertyChanged(nameof(ColumnNum)); } }
        /// <summary>
        /// 主页显示
        /// </summary>
        public bool HomeVis { get => homevis; set { homevis = value; RaisePropertyChanged(nameof(HomeVis)); } }
        /// <summary>
        /// 是否扫码（1是）
        /// </summary>
        public bool IsSma { get => IsSma_; set { IsSma_ = value; RaisePropertyChanged(nameof(IsSma)); } }
        /// <summary>
        /// 是否Check过站管控
        /// </summary>
        public bool IsCheck { get => IsCheck_; set { SetProperty(ref IsCheck_, value); } }

        /// <summary>
        /// 通过值（芯片）。原意义：通过警告值
        /// </summary>
        public decimal? OkValWarn { get => OkValWarn_; set { OkValWarn_ = value; RaisePropertyChanged(nameof(OkValWarn)); } }
        /// <summary>
        /// 通过值
        /// </summary>
        public decimal? OkVal { get => OkVal_; set { OkVal_ = value; RaisePropertyChanged(nameof(OkVal)); } }
        /// <summary>
        /// 单次宽度
        /// </summary>
        public int? OneWidth { get => OneWidth_; set { OneWidth_ = value; RaisePropertyChanged(nameof(OneWidth)); } }
        /// <summary>
        /// 单次运载起点
        /// </summary>
        public int? OneYz1 { get => OneYz1_; set { OneYz1_ = value; RaisePropertyChanged(nameof(OneYz1)); } }
        /// <summary>
        /// 单次运载终点
        /// </summary>
        public int? OneYz2 { get => OneYz2_; set { OneYz2_ = value; RaisePropertyChanged(nameof(OneYz2)); } }
        /// <summary>
        /// 单次扫描起点
        /// </summary>
        public int? OneSmi1 { get => OneSmi1_; set { OneSmi1_ = value; RaisePropertyChanged(nameof(OneSmi1)); } }
        /// <summary>
        /// 单次扫描终点
        /// </summary>
        public int? OneSmi2 { get => OneSmi2_; set { OneSmi2_ = value; RaisePropertyChanged(nameof(OneSmi2)); } }
        /// <summary>
        /// 单次扫码起点
        /// </summary>
        public int? OneSma1 { get => OneSma1_; set { OneSma1_ = value; RaisePropertyChanged(nameof(OneSma1)); } }
        /// <summary>
        /// 单次扫码终点
        /// </summary>
        public int? OneSma2 { get => OneSma2_; set { OneSma2_ = value; RaisePropertyChanged(nameof(OneSma2)); } }
        /// <summary>
        /// 连续运载起点
        /// </summary>
        public int? TwoYz1 { get => TwoYz1_; set { TwoYz1_ = value; RaisePropertyChanged(nameof(TwoYz1)); } }
        /// <summary>
        /// 连续运载终点
        /// </summary>
        public int? TwoYz2 { get => TwoYz2_; set { TwoYz2_ = value; RaisePropertyChanged(nameof(TwoYz2)); } }
        /// <summary>
        /// 连续扫描起点
        /// </summary>
        public int? TwoSmi1 { get => TwoSmi1_; set { TwoSmi1_ = value; RaisePropertyChanged(nameof(TwoSmi1)); } }
        /// <summary>
        /// 连续扫描终点
        /// </summary>
        public int? TwoSmi2 { get => TwoSmi2_; set { TwoSmi2_ = value; RaisePropertyChanged(nameof(TwoSmi2)); } }
        /// <summary>
        /// 连续扫码起点
        /// </summary>
        public int? TwoSma1 { get => TwoSma1_; set { TwoSma1_ = value; RaisePropertyChanged(nameof(TwoSma1)); } }
        /// <summary>
        /// 连续扫码终点
        /// </summary>
        public int? TwoSma2 { get => TwoSma2_; set { TwoSma2_ = value; RaisePropertyChanged(nameof(TwoSma2)); } }
        /// <summary>
        /// 排序码
        /// </summary>
        public int? Sort { get => Sort_; set { Sort_ = value; RaisePropertyChanged(nameof(Sort)); } }
        #endregion





        #region PLC相关界面

        private int? yzLoca;

        public int? YzLoca
        {
            get { return yzLoca; }
            set { yzLoca = value; RaisePropertyChanged(nameof(YzLoca)); }
        }

        private int? sMiLoca;

        public int? SMiLoca
        {
            get { return sMiLoca; }
            set { sMiLoca = value; RaisePropertyChanged(nameof(SMiLoca)); }
        }

        private int? sMaLoca;

        public int? SMaLoca
        {
            get { return sMaLoca; }
            set { sMaLoca = value; RaisePropertyChanged(nameof(SMaLoca)); }
        }

        private string yzLocaZd;

        public string YzLocaZd
        {
            get { return yzLocaZd; }
            set { yzLocaZd = value; RaisePropertyChanged(nameof(YzLocaZd)); }
        }

        private string sMiLocaZd;

        public string SMiLocaZd
        {
            get { return sMiLocaZd; }
            set { sMiLocaZd = value; RaisePropertyChanged(nameof(SMiLocaZd)); }
        }

        private string sMaLocaZd;

        public string SMaLocaZd
        {
            get { return sMaLocaZd; }
            set { sMaLocaZd = value; RaisePropertyChanged(nameof(SMaLocaZd)); }
        }

        private string smy;

        public string Smy
        {
            get { return smy; }
            set { smy = value; RaisePropertyChanged(nameof(Smy)); }
        }


        private string smq;

        public string Smq
        {
            get { return smq; }
            set { smq = value; RaisePropertyChanged(nameof(Smq)); }
        }

        #endregion

    }
}
